<template>
	<el-dialog title="详情" :close-on-click-modal="false" :visible.sync="visible">
		<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
			<el-form-item label="供应商" prop="supplierId">
				
				<div v-model="dataForm.supplierName">{{dataForm.supplierName}}</div>
			</el-form-item>
			<el-form-item label="原料列表">
				<el-table :data="rawMList" border style="width: 100%;">
					<el-table-column prop="rawMaterialName" header-align="center" align="center" label="原料名称"></el-table-column>
					<el-table-column prop="specs" header-align="center" align="center" label="规格"></el-table-column>
					<el-table-column header-align="center" align="center" label="数量">
						<template slot-scope="scope">
							<div v-show="scope.row.sign === 1" v-model="pInfo.rawNumber" placeholder="数量"></div>
							<div v-show="scope.row.sign === 0">{{scope.row.rawNumber}}</div>
						</template>
					</el-table-column>
					<el-table-column header-align="center" align="center" label="采购价">
						<template slot-scope="scope">
							<div v-show="scope.row.sign === 1" v-model="pInfo.purchasePrice" placeholder="采购价"></div>
							<div v-show="scope.row.sign === 0">{{scope.row.purchasePrice}}</div>
						</template>
					</el-table-column>
					<el-table-column header-align="center" align="center" label="总价">
						<template slot-scope="scope">
							<div style="color: red;">￥{{scope.row.rowPrice}}元</div>
						</template>
					</el-table-column>
				</el-table>
				<div style="text-align: center;color: red;">总计：￥{{dataForm.totalMoney}}元</div>
			</el-form-item>
			<el-form-item label="实付金额" prop="reallyPayMoney"><div style="color: red;">￥{{dataForm.reallyPayMoney}}元</div></el-form-item>
			<el-form-item label="支付方式" prop="payMthod">
				<div>{{dataForm.payMthod}}</div>
			</el-form-item>
			<el-form-item label="其他费用" prop="otherConst"><div>{{dataForm.otherConst}}</div></el-form-item>
			<el-form-item label="备注" prop="remark"><div>{{dataForm.remark}}</div></el-form-item>
			
		</el-form>
	</el-dialog>
</template>

<script>
export default {
	components: {
		
	},

	data() {
		return {
			visibles:false,
			rawTypeList: [],
			supplierList: [],
			rawMList:[],
			visible: false,
			dataForm:'',
			dataRule: {
				supplierId: [{ required: true, message: '供应商不能为空', trigger: 'blur' }],
				warehouseId: [{ required: true, message: '仓库不能为空', trigger: 'blur' }],
				reallyPayMoney: [{ required: true, message: '实付金额不能为空', trigger: 'blur' }]
			},
			pInfo:{
				rawNumber:'',
				purchasePrice:''
			},
			UpdateVisible:false,
			totalPrice:0
		};
	},

	methods: {

		init(row) {
			console.log("row   "+JSON.stringify(row))
			this.visible = true
			var json = JSON.parse(row.inFactoryRawMeterialList)
			this.rawMList = json
			this.dataForm = row
		},
	}
};
</script>
